﻿using ProjScan.RecordManager;
using ProjScan.RecordManager.AssetData;
using ProjScan.ScanRule.Attr;
using UnityEditor;
using UnityEngine;

namespace ProjScan.ScanRule.ProjectAssets.AudioClip
{
    [AudioRuleAttr]
    internal class Audio_OptimizeSampleRate : RecordRuleImp<AudioClipAssetData, AudioRecordManager>
    {
        protected override bool IsOK(AudioClipAssetData assetData)
        {
            if (assetData.compressionFormat == AudioCompressionFormat.PCM || assetData.compressionFormat == AudioCompressionFormat.ADPCM)
            {
                return assetData.sampleRateSetting == AudioSampleRateSetting.OptimizeSampleRate;
            }

            return true;
        }
    }
}
